/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.lostreseditores.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author DILOVE
 */
@Embeddable
public class GradoinstitucionPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_institucion")
    private int idInstitucion;
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_grado")
    private int idGrado;

    public GradoinstitucionPK() {
    }

    public GradoinstitucionPK(int idInstitucion, int idGrado) {
        this.idInstitucion = idInstitucion;
        this.idGrado = idGrado;
    }

    public int getIdInstitucion() {
        return idInstitucion;
    }

    public void setIdInstitucion(int idInstitucion) {
        this.idInstitucion = idInstitucion;
    }

    public int getIdGrado() {
        return idGrado;
    }

    public void setIdGrado(int idGrado) {
        this.idGrado = idGrado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idInstitucion;
        hash += (int) idGrado;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GradoinstitucionPK)) {
            return false;
        }
        GradoinstitucionPK other = (GradoinstitucionPK) object;
        if (this.idInstitucion != other.idInstitucion) {
            return false;
        }
        if (this.idGrado != other.idGrado) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.lostreseditores.modelo.GradoinstitucionPK[ idInstitucion=" + idInstitucion + ", idGrado=" + idGrado + " ]";
    }
    
}
